#!/usr/bin/env python

import nxt.locator
from nxt.sensor import *

def test_sensors(b):
        global result
        if nxtport == 1:
                port = PORT_1
        elif nxtport == 2:
                port = PORT_2
        elif nxtport == 3:
                port = PORT_3
        elif nxtport == 4:
                port = PORT_4
        else:
                print 'Port not found...'

        result = SoundSensor(b, port).get_sample()

result = 1.0
sock = nxt.locator.find_one_brick()
if sock:
	test_sensors(sock.connect())
	sock.close()
else:
	print 'No NXT bricks found'
